******************
**** Table B7 ****
****************** 

use "$data/paymentdata_ready" , clear

keep if t==1

log using "$output/table b7", replace

reg postratiow1 treatmentalldummy2 treatmentalldummy3 treatmentalldummy4 treatmentalldummy5 treatmentalldummy6 treatmentalldummy7 teamdummy* firststickerdummy* , cluster(dayteam)

reg postratiow1 treatmentalldummy2 treatmentalldummy3 treatmentalldummy4 treatmentalldummy5 treatmentalldummy6 treatmentalldummy7 teamdummy* firststickerdummy* preratiow1 lastdebt_demeanedw1 prepaymentsmadedummy* , cluster(dayteam)


capture program drop Ey_boot
program define Ey_boot, eclass
twopm postratiow1 treatmentalldummy2-treatmentalldummy7 teamdummy* firststickerdummy* preratiow1 lastdebt_demeanedw1 prepaymentsmadedummy*, firstpart(probit) secondpart(regress) vce(cluster dayteam)
margins, dydx(treatmentalldummy2-treatmentalldummy7) nose post
end
bootstrap _b, seed(340) reps(1000): Ey_boot
estimates store E

test treatmentalldummy2 = treatmentalldummy4
test treatmentalldummy2 = treatmentalldummy5
test treatmentalldummy2 + treatmentalldummy3 = treatmentalldummy4 + treatmentalldummy5

test treatmentalldummy3 = treatmentalldummy6
test treatmentalldummy3 = treatmentalldummy7
test treatmentalldummy2 + treatmentalldummy3 = treatmentalldummy6 + treatmentalldummy7

test treatmentalldummy4 = treatmentalldummy6
test treatmentalldummy5 = treatmentalldummy7
test treatmentalldummy4 + treatmentalldummy5 = treatmentalldummy6 + treatmentalldummy7

test treatmentalldummy4 = treatmentalldummy5
test treatmentalldummy6 = treatmentalldummy7
test treatmentalldummy4 + treatmentalldummy6 = treatmentalldummy5 + treatmentalldummy7

log close

